package com.starmark.gateway.log.access.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.starmark.core.framework.base.AbstractBaseService;
import com.starmark.gateway.log.access.entity.GatewayAccessLog;
import com.starmark.gateway.log.access.mapper.GatewayAccessLogMapper;
import com.starmark.gateway.log.access.service.IGatewayAccessLogService;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 系统访问日志 服务实现类
 * </p>
 *
 * @author starmark
 * @since 2018-12-15
 */
@Service
public class GatewayAccessLogServiceImpl extends AbstractBaseService<GatewayAccessLogMapper, GatewayAccessLog> implements IGatewayAccessLogService {


    @Override
    public void buildPageSearch(Map<String, Object> params, QueryWrapper<GatewayAccessLog> eWrapper) {
        if (params.get("keyword") != null && StrUtil.isNotEmpty(params.get("keyword") + "")) {
            eWrapper.like("title", params.get("keyword") + "");
        }
        //查询工程ID
        eWrapper.eq("project_code", params.get("projectCode") + "");

        eWrapper.orderByDesc("id");
    }
}
